--- @param extension Package
--- @param HY HY_Utility
--- @param U Utility
return function(extension, HY, U)
    local hy_fujiwara_no_mokou = General:new(extension, "hy_fujiwara_no_mokou", "jin_k", 3, 3, General.Female)
    local suicidality = fk.CreateSkill {
        name = "suicidality",
    }
    suicidality:addEffect(fk.EventPhaseStart, {
        anim_type = "drawcard",
        can_trigger = function(self, event, target, player, data)
            if not player:hasSkill(suicidality.name) or target ~= player then
                return false
            end
            return player.phase == Player.Play and not player.chained
        end,
        on_cost = function(self, event, target, player, data)
            return player.room:askToSkillInvoke(player, {
                skill_name = suicidality.name,
                prompt = "suicidality_prompt"
            })
        end,
        on_use = function(self, event, target, player, data)
            local room = player.room
            if not player.dead then
                if player:isWounded() then
                    local targets = room:askToChoosePlayers(player, {
                        targets = table.filter(room:getOtherPlayers(player), function(t)
                            return not t.chained
                        end),
                        min_num = 0,
                        max_num = player.maxHp - player.hp,
                        skill_name = suicidality.name,
                        prompt = "suicidality_chained_prompt:::" .. tostring(player.maxHp - player.hp)
                    })
                    for _, t in ipairs(targets) do
                        t:setChainState(true)
                    end
                end
                player:setChainState(true)
            end
        end,
    })
    suicidality:addEffect(fk.DamageInflicted, {
        anim_type = "drawcard",
        can_trigger = function(self, event, target, player, data)
            if not player:hasSkill(suicidality.name) or target ~= player then
                return false
            end
            return player.chained
        end,
        on_cost = Util.TrueFunc,
        on_use = function(self, event, target, player, data)
            data:changeDamage(1)
        end,
    })
    suicidality:addEffect("targetmod", {
        bypass_times = function(self, player, skill, scope, card, to)
            return player:hasSkill(suicidality.name) and player.chained
        end
    })
    local reincanation = fk.CreateSkill {
        name = "reincanation",
    }
    reincanation:addEffect(fk.HpRecover, {
        anim_type = "drawcard",
        can_trigger = function(self, event, target, player)
            return player:hasSkill(reincanation.name) and player == target and player.hp <= 0
        end,
        on_cost = Util.TrueFunc,
        on_use = function(self, event, target, player)
            local value = math.max(0, 1 - player.hp)
            player.room:changeHp(player, value, nil, reincanation.name)
        end,
    })
    reincanation:addEffect(fk.EnterDying, {
        anim_type = "drawcard",
        can_trigger = function(self, event, target, player)
            return player:hasSkill(reincanation.name) and player == target
        end,
        on_cost = Util.TrueFunc,
        on_use = function(self, event, target, player)
            if not player.dead then
                player.room:drawCards(player, 2 * (1 - player.hp), reincanation.name)
            end
        end,
    })
    reincanation:addEffect("maxcards", {
        fixed_func = function(self, player)
            if player:hasSkill(reincanation.name) then
                return player.maxHp
            end
        end
    })
    extension:loadSkillSkels { suicidality, reincanation }
    hy_fujiwara_no_mokou:addSkill("suicidality")
    hy_fujiwara_no_mokou:addSkill("reincanation")
    Fk:loadTranslationTable {
        ["hy_fujiwara_no_mokou"] = "藤原妹红",
        ["#hy_fujiwara_no_mokou"] = "燃己恒焰",
        ["illustrator:hy_fujiwara_no_mokou"] = "Blanc.",
        ["designer:hy_fujiwara_no_mokou"] = "黑曜人形",
        ["cv:hy_fujiwara_no_mokou"] = "",

        ["suicidality"] = "舍身",
        [":suicidality"] = "出牌阶段开始时，你可以令你与至多X名其他角色横置。若你已横置，你使用牌无次数限制且受到的伤害+1（X为你已损失体力值）。",
        ["suicidality_prompt"] = "舍身：令你与其他角色横置",
        ["suicidality_chained_prompt"] = "选择至多%arg名其他角色横置",

        ["reincanation"] = "再诞",
        [":reincanation"] = "你的手牌上限为你的体力上限。当你于濒死状态回复体力后，你将体力值调整至1点。在你进入濒死状态时，你摸2Y张牌（Y为你此次濒死求桃数）。",
    }
end
